<template>
    <div id="modall">
        <modal :visible="visible" @on-cancel="cancel" @on-sure="sure"></modal>

        <button @click="showModal">点击显示模块框</button>
    </div>
</template>
<script>
    import modal from "../../pages/modal"
    export default{
        components:{
            modal
        },
        data(){
            return{
                visible:false
            }
        },
        methods:{
            showModal(){
                this.visible = true
            },
            cancel(){
                this.visible = false
                alert('取消了')
            },
            sure(){
                this.visible = false
                alert('确定了')
            }

           
        }

    }
    
    
</script>